package com.gopay.bis.manager.bank.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.bis.dao.payconfig.BisExpayDtlDAO;
import com.gopay.bis.manager.bank.BisExpayDtlManager;
import com.gopay.common.domain.bank.BisBankExpayDtl;
import com.gopay.common.util.DateUtils;

/** 
 * 鉴权流水manager实现
 * @ClassName: BisExpayDtlManagerImpl 
 * @author w_jiqing 
 * @date 2017年2月10日 下午1:24:53  
 */ 
@Service("bisExpayManager")
public class BisExpayDtlManagerImpl implements BisExpayDtlManager{
    
    @Resource(name="bisExpayDtlDAO")
    private BisExpayDtlDAO bisExpayDtlDAO;
    

    @Override
    public BisBankExpayDtl addBisExpayDtl(BisBankExpayDtl bcd) {
        Date curDate = DateUtils.getSystemDate();
        bcd.setCreatedTime(curDate);
        bcd.setLastUpdTs(curDate);
        bcd = bisExpayDtlDAO.save(bcd);
        return bcd;
    }

    @Override
    public void updateExpayDtl(BisBankExpayDtl bcd) {
        Date curDate = DateUtils.getSystemDate();
        bcd.setLastUpdTs(curDate);
        bisExpayDtlDAO.update(bcd);
        
    }

    @Override
    public BisBankExpayDtl getExpayDtlByOrderId(String orderId) {
        return bisExpayDtlDAO.getBisExpayDtl(orderId);      
    }

    @Override
    public List<BisBankExpayDtl> getExpayDtlByOrderIdList(String orderId, String status) {
        return bisExpayDtlDAO.getBisExpayDtlList(orderId, status);
    }

    @Override
    public List<BisBankExpayDtl> getExpayDtlByOrderIdAndElementsList(String orderId, String elements, String status) {
        return bisExpayDtlDAO.getBisExpayDtlList(orderId, elements, status);
    }
    
}
       
        

